package com.xhwy.enums;

//自定义枚举类：用户状态
public class UserState1 {
    //1.声明UserState1对象的属性：private final修饰
    private final Integer stateCode;//状态码
    private final String stateDesc;//状态简述

    //2.私有化构造器
    private UserState1(Integer stateCode, String stateDesc) {
        this.stateCode = stateCode;
        this.stateDesc = stateDesc;
    }

    //3.提供当前枚举类的多个对象public static final修饰
    public static final UserState1 NORMAL = new UserState1(0,"正常状态");
    public static final UserState1 LOCKED = new UserState1(1,"锁定状态");

    @Override
    public String toString() {
        return "UserState1{" +
                "stateCode=" + stateCode +
                ", stateDesc='" + stateDesc + '\'' +
                '}';
    }
}
